package edu.sctu.wujiayi.month06.day20150626.json_practiceone;

/**
 * Created by user11 on 2015/6/26.
 */
//public class UrlJson {
//
//    public URL url;
//    public String path = "http://api.ii.com.cn";
//    public Scanner scan = new Scanner(System.in);
//
//    public void setPostUrl() throws IOException {
//        String pathadd = path + scan.next();
//
//        url = new URL(pathadd);
//
//        HttpURLConnection httpConnection = (HttpURLConnection) url.openConnection();
//
//        httpConnection.connect();
//
//        httpConnection.setDoOutput(true);
//
//        httpConnection.setDoInput(true);
//
//        OutputStream outputStream = (OutputStream) httpConnection.getOutputStream();
//        outputStream.write("".getBytes());
//
//        InputStream inputStream = httpConnection.getInputStream();
//        byte beth[] = new byte[1024 * 10];
//        inputStream.read(beth);
//    }
//
//    public String setGetUrl(String path) throws IOException {
//
//        url = new URL(path);
//
//        HttpURLConnection httpURLConnection = (HttpURLConnection) url.openConnection();
//
//        httpURLConnection.connect();
//
//        InputStream inputstream = httpURLConnection.getInputStream();
//        byte value[] = new byte[1];
//
//        String json = "";
//        while (inputstream.read(value) != -1){
//            json = json + new String(value);
//        }
//
////        System.out.println(json);
//        return json;
//    }
//}